//
//  TuijianDetialTabHeadView.swift
//  xmly
//
//  Created by 刘文超 on 2020/1/8.
//  Copyright © 2020 刘文超. All rights reserved.
//

import UIKit

class TuijianDetialTabHeadView: UIView {

    lazy var bgImageView:UIImageView = {
            let imageview = UIImageView.init()
            imageview.backgroundColor = arc4randomColor
            imageview.contentMode = .scaleAspectFill
            imageview.layer.masksToBounds = true
            imageview.image = UIImage.init(named: "background_dark")
            return imageview
    }()
    
    lazy var shopImageView:UIImageView = {
          let imageview = UIImageView.init()
          imageview.backgroundColor = arc4randomColor
          imageview.contentMode = .scaleAspectFit
          return imageview
      }()
    
    lazy var titleLabel:UILabel = {
            let label = UILabel.init()
            label.font = .systemFont(ofSize: 20)
            label.text = "天才在左，疯子在右"
            label.textColor = UIColor.white
            return label
    }()
    
    lazy var jianjieLabel:UILabel = {
        let label = UILabel.init()
        label.font = .systemFont(ofSize: 16)
        return label
    }()
    
    
    lazy var soreLabel:UILabel = {
        let label = UILabel.init()
        label.font = .systemFont(ofSize: 16)
        return label
    }()
  
    lazy var timeLabel:UILabel = {
        let label = UILabel.init()
        label.font = .systemFont(ofSize: 16)
        return label
    }()
    
    
    lazy var dingyueButton:UIButton = {
        let button = UIButton.init()
        button.setTitleColor(UIColor.white, for: .normal)
        button.setTitle("订阅", for: .normal)
        button.layer.cornerRadius = 15
        button.layer.masksToBounds = true
        button.backgroundColor = UIColor.orange
        return button
    }()
    
    
    override init(frame: CGRect) {
        super.init(frame: frame)
        
        layoutUI()
    }
    
    required init?(coder: NSCoder) {
        fatalError("init(coder:) has not been implemented")
    }
    
    func layoutUI() {
        self.addSubview(bgImageView)
        bgImageView.snp.makeConstraints { (make) in
            make.left.right.top.equalToSuperview()
            make.height.equalTo(180)
        }
        
        self.addSubview(shopImageView)
        shopImageView.snp.makeConstraints { (make) in
            make.left.equalTo(20)
            make.top.equalTo(80)
            make.size.equalTo(CGSize.init(width: 60, height: 100))
        }
        
        
        self.addSubview(titleLabel)
        titleLabel.snp.makeConstraints { (make) in
            make.left.equalTo(shopImageView.snp.right).offset(12)
            make.right.equalToSuperview().offset(-10)
            make.top.equalTo(shopImageView.snp.top).offset(10)
        }
        
        self.addSubview(jianjieLabel)
        jianjieLabel.snp.makeConstraints { (make) in
            make.left.equalTo(shopImageView.snp.right).offset(12)
            make.right.equalToSuperview().offset(-10)
            make.top.equalTo(titleLabel.snp.top).offset(10)
        }
        
        
//        self.addSubview(<#T##view: UIView##UIView#>)
        
        
        
        
    }
    
}
